﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace BrainTechLLC.ImageOperatorsNonAForgeDependent
{
    public class BasicByteArrayPopulator
    {
        public virtual byte[] Populate(BasicByteArray item, ICoreDataProvider dataProvider, string fileName)
        {
            byte[] populated = dataProvider.ReadAllImageBytes(fileName);
            item.Bytes = populated;
            return populated;
        }

        public virtual byte[] PopulateIfEmpty(BasicByteArray item, ICoreDataProvider dataProvider, string fileName)
        {
            byte[] populated = item.Bytes;
            if (populated == null)
            {
                populated = Populate(item, dataProvider, fileName);
            }
            return populated;
        }
    }
}
